package com.rest.demo.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class UrlEncode {

    public String Encode(String Qc) throws UnsupportedEncodingException {

        String encode = URLEncoder.encode(Qc, "utf-8");
//        System.out.println("乱码" + encode);

        String decode = URLDecoder.decode(encode, "utf-8");// GBK解码
//        System.out.println(decode);
        return encode;
    }

}
